﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Lon.Server
{
    public partial class UserEditForm : Form
    {
        public UserEditForm()
        {
            InitializeComponent();
        }

        public string UserName
        {
            get { return txtUserName.Text; }
            set { txtUserName.Text = value; }
        }

        public string Password
        {
            get { return txtPassword.Text; }
            set { txtPassword.Text = value; }
        }

        public int Level
        {
            get { return Convert.ToInt32(txtLevel.Text); }
            set { txtLevel.Text = value.ToString(); }
        }

        public string Memo
        {
            get { return txtMemo.Text; }
            set { txtMemo.Text = value; }
        }


        public void AddUserMode()
        {
            this.Text = "添加用户";
            this.txtUserName.Enabled = true;
            this.txtPassword.Enabled = true;
            this.txtLevel.Enabled = true;
            this.txtMemo.Enabled = true;
        }

        public void EditPasswordMode()
        {
            this.Text = "修改密码";
            this.txtUserName.Enabled = false;
            this.txtPassword.Enabled = true;
            this.txtLevel.Enabled = false;
            this.txtMemo.Enabled = false;
        }

        public void EditMemoMode()
        {
            this.Text = "修改备注";
            this.txtUserName.Enabled = false;
            this.txtPassword.Enabled = false;
            this.txtLevel.Enabled = false;
            this.txtMemo.Enabled = true;
        }

    }

   
}
